﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace ShevaEngine.Core.Modules.ArtificialIntelligence.Pathfinding
{
    /// <summary>
    /// Navigation graph connection.
    /// </summary>
    public class NavigationGraphConnection
    {
        /// <summary>Vertex 1.</summary>
        public Vector3 Vertex1;
        /// <summary>Vertex 2.</summary>
        public Vector3 Vertex2;
        /// <summary>Node 1.</summary>
        public NavigationGraphNode Node1;
        /// <summary>Node 2.</summary>
        public NavigationGraphNode Node2;
        /// <summary>Cost.</summary>
        public float Cost;
        /// <summary>Edge center vertex.</summary>
        public Vector3 Center { get { return (this.Vertex1 + this.Vertex2) / 2; } }

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="vertex1"></param>
        /// <param name="vertex2"></param>
        /// <param name="node1"></param>
        /// <param name="node2"></param>
        public NavigationGraphConnection(Vector3 vertex1, Vector3 vertex2, 
            NavigationGraphNode node1, NavigationGraphNode node2, float cost)
        {
            this.Vertex1 = vertex1;
            this.Vertex2 = vertex2;
            this.Node1 = node1;
            this.Node2 = node2;
            this.Cost = cost;
        }
    }
}
